package com.xiguaji.tiktok.task.awemecomment;

import com.gugee.tiktok.common.model.mysql.BloggerLog;
import com.xiguaji.boot.eventbus.EventBusTemplate;
import com.xiguaji.tiktok.task.awemecomment.service.CommentService;
import com.xiguaji.tiktok.task.core.ScheduleTemplate;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class AwemeCommentTask {
    @Autowired
    EventBusTemplate eventBusTemplate;
    @Autowired
    ScheduleTemplate scheduleTemplate;
    @Autowired
    CommentService commentService;

    /**
     * 根据粉丝排行的顺序，对播主下视频评论的采集消息发送
     * @param param
     * @return
     */
    @XxlJob("sendComment2kafkaByBloggerFlowersHandler")
    public ReturnT<String> sendComment2kafkaByBloggerFlowersHandler(String param) {
        return commentService.xxlJobStart(BloggerLog.BloggerLogType.SEND_COMMENT_2_KAFKA,"sendComment2kafkaByBloggerFlowersHandler",param,false);
    }
    /**
     * 根据粉丝排行topn和视频排行topN的顺序，视频评论的采集消息发送
     * @param param
     * @return
     */
    @XxlJob("sendComment2kafkaByBloggerFlowerTopHandler")
    public ReturnT<String> sendComment2kafkaByBloggerFlowerTopHandler(String param) {
        return commentService.xxlJobStart(null,"sendComment2kafkaByBloggerFlowerTopHandler",param,true);
    }


}


